package org.zjt.mock.demo.mock.config;


import org.springframework.core.convert.converter.Converter;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * Description:
 *
 * @author juntao.zhang
 * Date: 2018-06-21 下午8:51
 * @see
 */
public class LocalDateTimeConverter implements Converter<LocalDateTime,String> {

    private static final DateTimeFormatter DATE_TIME_FORMATTER =  DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    @Override
    public String convert(LocalDateTime source) {
        return source.format(DATE_TIME_FORMATTER);
    }
}
